#include<bits/stdc++.h>
#define int long long
#define fi first
#define se second
#define endl "\n"
#define _for(i, a, b) for(int i = a; i <= b; ++i)
#define IOS ios::sync_with_stdio(false),cin.tie(0),cout.tie(0)
using namespace std;

const int N = 1e5 + 10;

signed main() {
	IOS;
	int k;
	cin >> k;
	_for(i, 1, 3e6) {
		k /= __gcd(i, k);
		if(k == 1) {
			cout << i << endl;
			return 0; 
		}
	}
	cout << k << endl;
	return 0;
}

